package com.study.service.impl;
import com.github.pagehelper.PageHelper;
import com.study.dao.UserDao;
import com.study.domain.User;
import com.study.service.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
@Service
public class UserServiceImpl implements UserService {

    @Resource
    private UserDao userDao;

    @Override
    public int insertUser(User user) {
        return  userDao.addUser(user);
    }

    @Override
    public int deleteUser(Integer id) {
        return   userDao.removeUser(id);
    }

    @Override
    public int modifyUser(User user) {
        return userDao.updateUser(user);
    }
    @Override
    public List<User> selectUsers() {

        return userDao.queryUsers();
    }
    @Override
    public User selectUserById(Integer uid) {
        return userDao.queryUserById(uid);
    }
}
